package com.xy.test;

import com.xy.ext.ExtConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/4/10 11:16
 * @description
 */

//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(classes = ExtConfig.class)
public class IOCTest_Ext {
    //@Autowired
    //private ApplicationContext context;

    @Test
    public void test01() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ExtConfig.class);
        context.publishEvent(new ApplicationEvent(new String("发布事件")) {
         });
        context.close();
    }
}

